package com.colorful.exceldemo.toolkit;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author guolong
 * @Date 2022/2/17 14:50
 * @Version 1.0
 */
public class UploadExcelListener<T> extends AnalysisEventListener<T> {

    List<T> list=new ArrayList<>();

    @Override
    public void invoke(T t, AnalysisContext analysisContext) {
        list.add(t);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }

    public List<T> getData(){
        return list;
    }
}
